package com.javachmapi.springbootjdbctemplatemultipledatasources.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

/**
 * create by 宋利军
 */
@Configuration
public class JdbcTemplateConfig {
    @Bean
    JdbcTemplate jdbcTemplateOne(@Qualifier("dsOne") DataSource datasource){
        return new JdbcTemplate(datasource);
    }
    @Bean
    JdbcTemplate jdbcTemplateTow(@Qualifier("dsTow") DataSource datasource){
        return new JdbcTemplate(datasource);
    }
}
